package grpc

import (
	"aggregation/config"
	"context"
	"fmt"
	"proto/dto"
	"proto/manager"
)

// UserClient example client, in reality, you should replace it with your own grpc client
// var UserClient example.UserService

func Init() func() {
	fmt.Println("------------------- grpc client ------------------- ")
	//UserClient = example.NewUserService("example.UserService", config.MicroService.Client())
	Device := manager.NewDeviceService("manager-grpc", config.MicroService.Client())
	rsp, err := Device.AesInfo(context.Background(), &dto.AesInfoRequest{
		Sn: "",
	})
	fmt.Println("--------- 1", rsp, " ", err)

	managerService := manager.NewManagerService("manager-grpc", config.MicroService.Client())
	rsp1, err1 := managerService.GetAlarmTypeList(context.Background(), &manager.GetAlarmTypeListReq{AlarmTypeIds: []int64{1}})
	fmt.Println("--------- 2", rsp1, " ", err1)
	return func() {}
}
